#pragma once
#include <drogon/HttpController.h>
using namespace drogon;
namespace demo
{
    namespace v1
    {
        class User : public drogon::HttpController<User>
        {
        public:
            METHOD_LIST_BEGIN
            // use METHOD_ADD to add your custom processing function here;
            ADD_METHOD_TO(User::getImg, "/getimg?ip={1}&ftpmethod={2}&path={3}&filename={4}", Get);
            ADD_METHOD_TO(User::getAllIpAddr, "/getallipaddr", Get);
            ADD_METHOD_TO(User::mountusb,"/mountusb",Get);
            ADD_METHOD_TO(User::camerastate, "/get_camera_state?reqipaddr={1}", Get);
            ADD_METHOD_TO(User::contactcamera, "/contact_camera", Post);
            ADD_METHOD_TO(User::poweroffcamera, "/poweroff_camera", Get);
            ADD_METHOD_TO(User::lsmedia, "/ls_media", Get);
            ADD_METHOD_TO(User::listfilesdetail, "/list_files_detail?path={1}", Get);
            ADD_METHOD_TO(User::mountusb,"/mountusb",Get);
            METHOD_LIST_END
            // your declaration of processing function maybe like this:
            void getImg(const HttpRequestPtr &req,
                       std::function<void(const HttpResponsePtr &)> &&callback,
                       std::string ip,std::string ftpmethod,std::string path,std::string filename);
            void getAllIpAddr(const HttpRequestPtr &req,
                         std::function<void(const HttpResponsePtr &)> &&callback) const;
            void camerastate(const HttpRequestPtr &req,
                       std::function<void(const HttpResponsePtr &)> &&callback,
                       std::string ipaddr);
            void contactcamera(const HttpRequestPtr &req,
                         std::function<void(const HttpResponsePtr &)> &&callback);
            
            void poweroffcamera(const HttpRequestPtr &req,
                         std::function<void(const HttpResponsePtr &)> &&callback);

            void lsmedia(const HttpRequestPtr &req,
                         std::function<void(const HttpResponsePtr &)> &&callback);

            void listfilesdetail(const HttpRequestPtr &req,
                         std::function<void(const HttpResponsePtr &)> &&callback,
                         std::string path);
            void mountusb(const HttpRequestPtr &req,
                         std::function<void(const HttpResponsePtr &)> &&callback);
            
        };
    }
}
